package dhm.com.dhmshop.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jcodecraeer.xrecyclerview.XRecyclerView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import dhm.com.dhmshop.R;
import dhm.com.dhmshop.base.BaseFragment;
import dhm.com.dhmshop.base.Presenter.PressenterImpl;
import dhm.com.dhmshop.base.netWork.LoginContract;
import dhm.com.dhmshop.utils.SpUtils;

/**
 * A simple {@link Fragment} subclass.
 */
public class ShopHomeFragment extends BaseFragment implements LoginContract.IView {

    @BindView(R.id.recy)
    XRecyclerView recy;
    Unbinder unbinder;

    private View rootView;
    private PressenterImpl pressenter;
    private String uid;
    @Override
    protected int getLayout() {
        return R.layout.shop_fragment;
    }





    @Override
    protected void initView() {
        pressenter=new PressenterImpl();
        pressenter.attachView(this);
        uid = SpUtils.getString(getActivity(), "uid");

    }

    @Override
    protected void initData() {

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (rootView == null) {
            rootView = inflater.inflate(R.layout.shop_fragment, container, false);
        }
        unbinder = ButterKnife.bind(this, rootView);
        initView();
        return rootView;
    }


    @Override
    public void requesta(Object data) {

    }

    @Override
    public void fail(String error) {

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
